<template>
  <div class="result">
    <CommonPage
      :title="status === 'success' ? '订购成功' : '订购失败'"
      path="home"
    >
      <template v-slot:content>
        <CommonSuccess v-if="status === 'success'"></CommonSuccess>
        <CommonFail v-else></CommonFail>
        <CommonAdvertise></CommonAdvertise>
      </template>
    </CommonPage>
  </div>
</template>

<script>
// @ is an alias to /src
import CommonPage from "@/components/common-page";
import CommonAdvertise from "./advertise";
import CommonSuccess from "./success";
import CommonFail from "./fail";
export default {
  name: "resultView",
  components: { CommonPage, CommonAdvertise, CommonSuccess, CommonFail },
  data() {
    return {
      status: "success",
    };
  },
  created() {
    this.status = this.$route.query.status;
  },
};
</script>

<style lang="less" scoped>
.result {
  .success,
  .fail {
  }
  .status-advertise {
    margin: 1rem 0 0 0;
  }
}
</style>
